<!DOCTYPE html>
<!--
/*************************************************************************
* Copyright (c) 2011 im007boy@gmail.com. All rights reserved.            *
* Use of this source code is governed by a GNU-style license that can be *
* found in the LICENSE file.                                             *
*************************************************************************/
-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>a</title>
<script>
localStorage['param'] = 'class="aligncenter" width="600" alt="iPhone Event"';
var menu = chrome.contextMenus.create({
        'type':'normal',
        'title':'Copy',
        'contexts':["image"],
        'onclick': function(info, tab){
            var text = document.getElementById('copy');
            text.value = '<img src=\"' + info.srcUrl + '\" ' + localStorage['param'] + ' />';
            text.select(); 
            console.log(document.execCommand('copy', false, null));
        }
    });

</script>
</head>
<body>
<input id="copy" type="text" />
</body>
</html>
